<template>
  <div>
    <el-row style="margin-left: 0px; margin-right: 0px;">
      <el-col :span="10">
        <h1>贷款申请</h1>
        <el-form :model="loan" label-width="120px">
          <el-form-item label="客户id">
            <el-input v-model="loan.customerId" />
          </el-form-item>
          <el-form-item label="贷款金额">
            <el-input v-model="loan.loanAmount" />
          </el-form-item>
          <el-form-item label="贷款用途">
            <el-input v-model="loan.purpose" />
          </el-form-item>
          <el-form-item label="收款银行卡号">
            <el-input v-model="loan.bankNumber" />
          </el-form-item>
          <el-form-item label="还款期限">
            <el-radio-group v-model="loan.loanTerm">
              <el-radio label="10年" value="20">10年(利率3.8%)</el-radio>
              <el-radio label="20年" value="20">20年(利率4.2%)</el-radio>
              <el-radio label="30年" value="30">30年(利率4.6%)</el-radio>
            </el-radio-group>
          </el-form-item>

          <el-form-item>
            <el-button type="primary" @click="doApply">提交申请</el-button>
          </el-form-item>
        </el-form>
      </el-col>
    </el-row>
  </div>
</template>

<script>
/* eslint-disable */
// 单独引入ElMessageBox
import { MessageBox } from 'element-ui'
import axios from 'axios'

export default {
  name: 'loanApply',
  data(){
    return  {
      loan: {
        name: null,
        email: null,
        sex: null,
        sport: [],
      }
    }
  },
  methods: {
    doApply() {

      axios.post("/api/loan-center/loanApply",this.loan).then(
          (res) => {
            this.loan = {};
            MessageBox.alert('申请成功!', '贷款申请');
          }
      )
    }
  }
}
</script>

<style>
</style>

